﻿<ResourceDictionary 
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:SLExtensions.Controls;assembly=SLExtensions.Controls"
    xmlns:localanim="clr-namespace:SLExtensions.Controls.Animation;assembly=SLExtensions.Controls"
    xmlns:layers="clr-namespace:SLExtensions.Controls.Layers;assembly=SLExtensions.Controls"
    xmlns:ve="clr-namespace:SLExtensions.Controls.Layers.VirtualEarth;assembly=SLExtensions.Controls"
    xmlns:gm="clr-namespace:SLExtensions.Controls.Layers.GoogleMaps;assembly=SLExtensions.Controls"
    xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"
    xmlns:sld="clr-namespace:SLExtensions.Data;assembly=SLExtensions.Data"
    >

    <Style TargetType="layers:LayerHost">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="layers:LayerHost">
                    <Canvas x:Name="RootElement"  Background="Transparent">
                        <Canvas x:Name="LayersHost" />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ve:HybridView">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="ve:HybridView">
                    <Canvas>
                        <ItemsPresenter />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ve:AerialView">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="ve:AerialView">
                    <Canvas>
                        <ItemsPresenter />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="ve:RoadView">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="ve:RoadView">
                    <Canvas>
                        <ItemsPresenter />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="gm:AerialView">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="gm:AerialView">
                    <Canvas>
                        <ItemsPresenter />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="gm:RoadView">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="gm:RoadView">
                    <Canvas>
                        <ItemsPresenter />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="layers:LayerSource">
        <Setter Property="ItemsPanel">
            <Setter.Value>
                <ItemsPanelTemplate>
                    <Canvas/>
                </ItemsPanelTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="layers:LayerSource">
                    <Canvas>
                        <ItemsPresenter />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="layers:LayerItem">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="layers:LayerItem">
                    <Canvas x:Name="RootElement">
                        <Canvas.Resources>
                            <Storyboard x:Name="Normal State"/>
                            <Storyboard x:Name="MouseOver State"/>
                            <Storyboard x:Name="Removing State"/>
                        </Canvas.Resources>
                        <ContentPresenter 
                          Content="{TemplateBinding Content}" 
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          Margin="{TemplateBinding Padding}" 
                          />
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="local:TreeView">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TreeView">
                    <Border
                        Name="Border"
                        CornerRadius="1"
                        BorderThickness="1" >
                        <!--<ScrollViewer Padding="4" x:Name="ScrollViewer" VerticalScrollBarVisibility="Auto" Background="{TemplateBinding Background}">-->
                        <ItemsPresenter/>
                        <!--</ScrollViewer>-->
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:TreeViewItem">
        <Setter Property="Padding" Value="1,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TreeViewItem">
                    <Grid x:Name="LayoutRoot" >
                        <Grid.Resources>
                            <Style x:Key="TreeViewItemExpanderButtonStyle" TargetType="ToggleButton">
                                <Setter Property="IsEnabled" Value="true"/>
                                <Setter Property="IsTabStop" Value="true"/>
                                <Setter Property="Background" Value="#FF003255"/>
                                <Setter Property="Foreground" Value="#FF313131"/>
                                <Setter Property="Margin" Value="0"/>
                                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="Cursor" Value="Arrow"/>
                                <Setter Property="FontSize" Value="11"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ToggleButton">
                                            <Grid Background="Transparent">
                                                <Grid.Resources>
                                                    <SolidColorBrush x:Key="GlyphBrush" Color="#444" />
                                                </Grid.Resources>

                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="Auto"/>
                                                    <ColumnDefinition Width="Auto"/>
                                                </Grid.ColumnDefinitions>

                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0:0:0.1" To="MouseOver"/>
                                                            <vsm:VisualTransition GeneratedDuration="0:0:0.1" To="Pressed"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CheckStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="0:0:0.1"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000" From="Checked" To="Unchecked"/>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000" From="Unchecked" To="Checked"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Checked">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unchecked">
                                                            <Storyboard>
                                                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ExpandPath" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                                                                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="-90"/>
                                                                </DoubleAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Indeterminate">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Unfocused">
                                                            <Storyboard/>
                                                        </vsm:VisualState>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Path x:Name="ExpandPath"
                                                    Opacity="0.995"
                                                    HorizontalAlignment="Left"
                                                    VerticalAlignment="Center"
                                                    Margin="1,1,1,1"
                                                    Fill="{StaticResource GlyphBrush}"
                                                    Data="M 0 4 L 8 4 L 4 8 Z" RenderTransformOrigin="0.5,0.5">
                                                    <Path.RenderTransform>
                                                        <TransformGroup>
                                                            <ScaleTransform/>
                                                            <SkewTransform/>
                                                            <RotateTransform/>
                                                            <TranslateTransform/>
                                                        </TransformGroup>
                                                    </Path.RenderTransform>
                                                </Path>

                                                <ContentPresenter 
                          Content="{TemplateBinding Content}" 
                          ContentTemplate="{TemplateBinding ContentTemplate}"
                          Margin="{TemplateBinding Padding}" 
                          />
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver"/>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="nodeSelection" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="nodeSelection" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1.0"/>
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unselected">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="nodeSelection" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="nodeSelection" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="ItemStates">
                                <vsm:VisualState x:Name="Expanded">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Collapsed">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="ItemsHost" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0.0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused"/>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SourceStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.2000000" To="HasItems"/>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.2000000" To="NoItems"/>
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="HasItems">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Expander" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="NoItems">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="Expander" Storyboard.TargetProperty="(UIElement.Opacity)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Grid.ColumnDefinitions>
                            <ColumnDefinition MinWidth="19" Width="Auto"/>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>

                        <Rectangle x:Name="nodeSelection" Grid.RowSpan="1" Grid.ColumnSpan="2" Stroke="Black" Fill="#AAAAAAFF" StrokeDashArray="2" Visibility="Collapsed" Opacity="0" />

                        <ToggleButton x:Name="Expander" 
                                      Style="{StaticResource TreeViewItemExpanderButtonStyle}" 
                                      IsChecked="{TemplateBinding IsExpanded}"
                                      Opacity="0" IsThreeState="False"
                                      Width="16" Height="16"/>
                        <Border x:Name="Bd"
								Grid.Column="1"
								Padding="{TemplateBinding Padding}" Background="Transparent">
                            <ContentControl x:Name="PART_Header" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" />
                        </Border>
                        <ItemsPresenter x:Name="ItemsHost"
								Visibility="Collapsed"
								Opacity="0"
								Grid.Row="1"
								Grid.Column="1"
								Grid.ColumnSpan="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:VirtualizedListBox">
        <Setter Property="Padding" Value="1,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:VirtualizedListBox">
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                            <ColumnDefinition Width="20"/>
                        </Grid.ColumnDefinitions>

                        <local:VirtualizedStackPanel x:Name="virtualizedStackPanel" local:MouseWheelGenerator.IgnoreMouseWheel="True" ItemContainerGenerator="{TemplateBinding ItemContainerGenerator}" Orientation="Vertical" ItemsSource="{TemplateBinding ItemsSource}" ItemTemplate="{TemplateBinding ItemTemplate}" />

                        <ScrollBar x:Name="scrollBar" Orientation="Vertical" Grid.Column="1" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:VirtualizedListBoxItem">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:VirtualizedListBoxItem">
                    <Grid Background="{TemplateBinding Background}">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="HoverOverlay" Storyboard.TargetProperty="Opacity" To=".75" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop0Hover" Storyboard.TargetProperty="Color" To="#FFF9FAFA" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop1Hover" Storyboard.TargetProperty="Color" To="#FFD6DFE7" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop2Hover" Storyboard.TargetProperty="Color" To="#FFD3E4F5" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop0Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop1Hover" Storyboard.TargetProperty="Color" To="#00000000" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="SelectionStates">
                                <vsm:VisualStateGroup.Transitions>
                                    <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                </vsm:VisualStateGroup.Transitions>
                                <vsm:VisualState x:Name="Unselected" />
                                <vsm:VisualState x:Name="Selected">
                                    <Storyboard>
                                        <ColorAnimation Storyboard.TargetName="fillStop0" Storyboard.TargetProperty="Color" To="#FFD9EFFF" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop1" Storyboard.TargetProperty="Color" To="#FFBDD2E6" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="fillStop2" Storyboard.TargetProperty="Color" To="#FFA1B6CD" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop0" Storyboard.TargetProperty="Color" To="#FF77B9EB" Duration="0" />
                                        <ColorAnimation Storyboard.TargetName="strokeStop1" Storyboard.TargetProperty="Color" To="#FF4887CD" Duration="0" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                            <vsm:VisualStateGroup x:Name="FocusStates">
                                <vsm:VisualState x:Name="Focused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Unfocused">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="FocusVisual" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>


                        <Rectangle IsHitTestVisible="False">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.316111,0.0165521" EndPoint="0.316111,0.724833">
                                    <GradientStop x:Name="fillStop0" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="fillStop1" Color="#00000000" Offset="0.682203"/>
                                    <GradientStop x:Name="fillStop2" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                            <Rectangle.Stroke>
                                <LinearGradientBrush StartPoint="0.318122,0.0360108" EndPoint="0.318122,0.715784">
                                    <GradientStop x:Name="strokeStop0" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="strokeStop1" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Stroke>
                        </Rectangle>
                        <Rectangle x:Name="HoverOverlay" IsHitTestVisible="False" Opacity="0">
                            <Rectangle.Fill>
                                <LinearGradientBrush StartPoint="0.316111,0.0165521" EndPoint="0.316111,0.724833">
                                    <GradientStop x:Name="fillStop0Hover" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="fillStop1Hover" Color="#00000000" Offset="0.682203"/>
                                    <GradientStop x:Name="fillStop2Hover" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                            <Rectangle.Stroke>
                                <LinearGradientBrush StartPoint="0.318122,0.0360108" EndPoint="0.318122,0.715784">
                                    <GradientStop x:Name="strokeStop0Hover" Color="#00000000" Offset="0"/>
                                    <GradientStop x:Name="strokeStop1Hover" Color="#00000000" Offset="1"/>
                                </LinearGradientBrush>
                            </Rectangle.Stroke>
                        </Rectangle>

                        <Rectangle x:Name="FocusVisual" Stroke="Black" StrokeDashArray="1,2" Visibility="Collapsed" IsHitTestVisible="False"/>
                        <ContentControl
                      Content="{TemplateBinding Content}"
                      ContentTemplate="{TemplateBinding ContentTemplate}"
                      />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:SwappableContentControl">
        <Setter Property="Padding" Value="1,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:SwappableContentControl">
                    <Grid x:Name="LayoutRoot" >
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="ShowPresenter1" >
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="wrapperElement2" Storyboard.TargetProperty="MarginHorizontalPercentShift">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="2"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="presenter2" Storyboard.TargetProperty="Visibility" >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="wrapperElement1" Storyboard.TargetProperty="MarginHorizontalPercentShift">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="2"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="2"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="presenter1" Storyboard.TargetProperty="Visibility" >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="ShowPresenter2">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="wrapperElement1" Storyboard.TargetProperty="MarginHorizontalPercentShift">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="2"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="presenter1" Storyboard.TargetProperty="Visibility" >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="wrapperElement2" Storyboard.TargetProperty="MarginHorizontalPercentShift">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.0000000" Value="2"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="2"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.4000000" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="presenter2" Storyboard.TargetProperty="Visibility" >
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00.2000000">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <ContentPresenter x:Name="presenter1" 
                      Content="{TemplateBinding Presenter1Content}"
                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Visibility="Collapsed"
                                        VerticalAlignment="Stretch"       
                                        HorizontalAlignment="Stretch"
                        />
                        <ContentPresenter x:Name="presenter2" 
                      Content="{TemplateBinding Presenter2Content}"
                      ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Visibility="Collapsed"
                                        VerticalAlignment="Stretch"       
                                        HorizontalAlignment="Stretch"
                        />

                        <localanim:MarginWrapper x:Name="wrapperElement1" ElementName="presenter1" MarginHorizontalPercentShift="2"/>
                        <localanim:MarginWrapper x:Name="wrapperElement2" ElementName="presenter2" MarginHorizontalPercentShift="2"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="local:ToolTip">
        <Setter Property="Foreground" Value="#FF313131" />
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush x:Name="ToolTipBackground" StartPoint="0,0" EndPoint="0,1">
                    <LinearGradientBrush.GradientStops>
                        <GradientStop Color="#FFF9FAFA" Offset="0" />
                        <GradientStop Color="#FFEDF1F4" Offset="0.37259" />
                        <GradientStop Color="#FFE2E8EF" Offset="0.372881" />
                        <GradientStop Color="#FFC3C9CD" Offset="1" />
                    </LinearGradientBrush.GradientStops>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="local:ToolTip">
                    <Border Background="#06000000"
                            Padding="1.5" 
                            CornerRadius="2">
                        <Border Background="#06000000"
                                Padding="1.5" 
                                CornerRadius="1.5">
                            <Border Background="#FFFFFFFF"
                                    BorderThickness=".5" 
                                    BorderBrush="#FF000000"
                                    CornerRadius="1.5"
                                    Padding="1">
                                <Border Name="RootElement" 
                                        Background="{TemplateBinding Background}"
                                        BorderThickness="1" 
                                        BorderBrush="#FFFFFFFF"
                                        CornerRadius="1.25"
                                        Padding="4,4,4,3">
                                    <Border.Resources>
                                        <Storyboard x:Key="Visible State"/>
                                        <Storyboard x:Key="Normal State"/>
                                    </Border.Resources>
                                    <ContentPresenter 
                                          Content="{TemplateBinding Content}" 
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Margin="{TemplateBinding Padding}" 
                                          />
                                </Border>
                            </Border>
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Viewbox">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="local:Viewbox">
                    <Canvas x:Name="LayoutRoot" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" >

                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ChangeTracker">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="local:ChangeTracker">
                    <StackPanel x:Name="RootElement" Orientation="Horizontal" Visibility="Collapsed">
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="ModificationStates">
                                <vsm:VisualState x:Name="Unchanged">
                                    <Storyboard/>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Modified">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootElement" Storyboard.TargetProperty="Visibility" Duration="0">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Button x:Name="CommitButton" Content="Save"/>
                        <Button x:Name="RevertButton" Margin="10, 0,0,0" Content="Cancel"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="local:ReCaptcha">
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="local:ReCaptcha">
                    <Grid x:Name="RootElement" >
                        <Grid.Resources>
                            <Style x:Key="reloadStyle" TargetType="Button">
                                <Setter Property="Template" >
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="LayoutRoot" Background="Transparent" >
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused"/>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF707070"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Path x:Name="path" Width="20" Height="20" Stretch="Fill" Fill="#FFC8D2D7" Margin="2"
													Data="M 125.383,67.5065L 114.107,63.7952L 117.031,61.8825C 115.134,59.798 112.399,58.4895 109.359,58.4895C 103.632,58.4895 98.9892,63.1322 98.9892,68.8593C 98.9892,74.5862 103.632,79.2289 109.359,79.2289C 113.645,79.2289 117.324,76.6285 118.904,72.9191L 125.935,75.5183C 123.295,82.0834 116.868,86.7182 109.359,86.7182C 99.4957,86.7182 91.4999,78.7225 91.4999,68.8592C 91.4999,58.996 99.4957,51.0002 109.359,51.0002C 115.024,51.0002 120.073,53.6379 123.345,57.7521L 126.5,55.6879L 125.383,67.5065 Z " />
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="imageStyle" TargetType="Button">
                                <Setter Property="Template" >
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="LayoutRoot" Background="Transparent" >
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused"/>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF707070"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Path x:Name="path" Width="16.88" Height="18" Margin="2" 
														Stretch="Fill" Fill="#FFC8D2D7" 
														Data="F1 M 288.34,235.84L 288.82,242.74L 287.928,242.74C 287.747,241.43 287.505,240.493 287.2,239.927C 286.7,239.022 286.035,238.355 285.205,237.925C 284.375,237.495 283.283,237.28 281.928,237.28L 277.3,237.28L 277.3,257.24C 277.3,259.26 277.502,260.52 277.907,261.02C 278.482,261.7 279.365,262.04 280.555,262.04L 281.62,262.04L 281.62,263L 268.66,263L 268.66,262.04L 269.74,262.04C 271.03,262.04 271.945,261.62 272.485,260.78C 272.815,260.26 272.98,259.08 272.98,257.24L 272.98,237.28L 269.14,237.28C 267.65,237.28 266.592,237.39 265.967,237.61C 265.147,237.905 264.448,238.475 263.868,239.32C 263.288,240.165 262.943,241.305 262.832,242.74L 261.94,242.74L 262.42,235.84L 288.34,235.84 Z "/>


                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="audioStyle" TargetType="Button">
                                <Setter Property="Template" >
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="LayoutRoot" Background="Transparent" >
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused"/>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF707070"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Path x:Name="path" Width="16" Height="20"
															Stretch="Fill" Fill="#FFC8D2D7" Margin="2"
															Data="M 195.6,166L 205.4,166L 205.4,180L 195.6,180L 195.6,166 Z M 223.527,147.751L 223.527,198.249L 209.722,183.467L 209.722,162.534L 223.527,147.751 Z "/>

                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="playStyle" TargetType="Button">
                                <Setter Property="Template" >
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="LayoutRoot" Background="Transparent" >
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused"/>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF707070"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Path x:Name="path" Width="19.2354" Height="22.2111" Margin="2"
													Stretch="Fill" Fill="#FFC8D2D7" Data="F1 M 305.907,123.667L 286.672,112.561L 286.672,134.772L 305.907,123.667 Z "/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="stopStyle" TargetType="Button">
                                <Setter Property="Template" >
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Button">
                                            <Grid x:Name="LayoutRoot" Background="Transparent" >
                                                <vsm:VisualStateManager.VisualStateGroups>
                                                    <vsm:VisualStateGroup x:Name="FocusStates">
                                                        <vsm:VisualState x:Name="Focused"/>
                                                        <vsm:VisualState x:Name="Unfocused"/>
                                                    </vsm:VisualStateGroup>
                                                    <vsm:VisualStateGroup x:Name="CommonStates">
                                                        <vsm:VisualStateGroup.Transitions>
                                                            <vsm:VisualTransition GeneratedDuration="00:00:00.2000000"/>
                                                        </vsm:VisualStateGroup.Transitions>
                                                        <vsm:VisualState x:Name="Normal"/>
                                                        <vsm:VisualState x:Name="MouseOver">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FFFFFFFF"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Pressed">
                                                            <Storyboard>
                                                                <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="path" Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)">
                                                                    <SplineColorKeyFrame KeyTime="00:00:00" Value="#FF707070"/>
                                                                </ColorAnimationUsingKeyFrames>
                                                            </Storyboard>
                                                        </vsm:VisualState>
                                                        <vsm:VisualState x:Name="Disabled"/>
                                                    </vsm:VisualStateGroup>
                                                </vsm:VisualStateManager.VisualStateGroups>
                                                <Rectangle x:Name="path" Width="18" Height="18" Margin="2" 
														Stretch="Fill" Fill="#FFC8D2D7" 
														/>


                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="44"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CaptchaStates">
                                <vsm:VisualState x:Name="Audio">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="audioButtons" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="mediaElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="showAudioElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="showImageElement" Storyboard.TargetProperty="(UIElement.Visibility)">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="Image">
                                    <Storyboard/>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
                        <Rectangle RadiusX="3" RadiusY="3" VerticalAlignment="Stretch" Grid.RowSpan="2" Grid.ColumnSpan="2" >
                            <Rectangle.Fill>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF790000" Offset="1"/>
                                    <GradientStop Color="#FFB72C19" Offset="0"/>
                                </LinearGradientBrush>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Image Source="{TemplateBinding ImageSource}" Stretch="None" Visibility="Visible" HorizontalAlignment="Stretch" Margin="5,5,5,5" x:Name="image" Width="300" Height="57">
                            <Image.Clip>
                                <RectangleGeometry Rect="0,0,300,57" RadiusX="3" RadiusY="3" />
                            </Image.Clip>
                        </Image>
                        <MediaElement AutoPlay="True" Source="{TemplateBinding WaveUri}" Visibility="Collapsed" 
							Height="57" Margin="5,5,5,5" VerticalAlignment="Bottom" Grid.ColumnSpan="1" x:Name="mediaElement" Width="300"/>
                        <StackPanel x:Name="audioButtons" Orientation="Horizontal" Visibility="Collapsed">
                            <Button x:Name="playElement" Content="Play" Style="{StaticResource playStyle}"/>
                            <Button x:Name="stopElement" Content="Stop" Style="{StaticResource stopStyle}"/>
                        </StackPanel>
                        <TextBox HorizontalAlignment="Stretch" VerticalAlignment="Top" TextWrapping="Wrap" Grid.Row="1" x:Name="inputElement"/>
                        <StackPanel Grid.Column="1">
                            <Button x:Name="showAudioElement" Content="Audio" Height="24" Style="{StaticResource audioStyle}"/>
                            <Button x:Name="showImageElement" Content="Image" Height="24" Style="{StaticResource imageStyle}" Visibility="Collapsed"/>
                            <Button x:Name="reloadElement" Content="Reload" Style="{StaticResource reloadStyle}" />
                            <HyperlinkButton Content="?" Grid.Column="1" Grid.Row="1" NavigateUri="http://recaptcha.net/popuphelp/" TargetName="_blank" Foreground="White" x:Name="hyperlinkButton" 
							VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
                            </HyperlinkButton>
                        </StackPanel>

                        <Button Grid.Column="1" Grid.Row="1" Content="Verify" x:Name="verifyElement"  >
                        </Button>

                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!--HtmlEditor-->
    <Style TargetType="local:HtmlEditor">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:HtmlEditor">
                    <Grid x:Name="RootElement" Background="{TemplateBinding Background}">

                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="CommonStates">
                                <vsm:VisualState x:Name="Normal" />
                                <vsm:VisualState x:Name="Disabled" />
                            </vsm:VisualStateGroup>

                            <vsm:VisualStateGroup x:Name="MenuStates">
                                <vsm:VisualState x:Name="Collapsed" />
                                <vsm:VisualState x:Name="ForeColor Expanded">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="ForeColorPalette" Storyboard.TargetProperty="Height" From="0"  To="48" />
                                    </Storyboard>
                                </vsm:VisualState>
                                <vsm:VisualState x:Name="BackgroundColor Expanded">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1" Storyboard.TargetName="BackgroundColorPalette" Storyboard.TargetProperty="Height" From="0"  To="48" />
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>

                        <Grid.Resources>
                            <localanim:HtmlAnimation x:Name="HtmlAnimationIframePlace">
                            </localanim:HtmlAnimation>
                            <Style x:Key="MenuColorButtonStyle" TargetType="Button">
                                <Setter Property="Width" Value="24"/>
                                <Setter Property="Height" Value="24"/>
                            </Style>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <local:DockPanel LastChildFill="True">
                            <StackPanel x:Name="PanelCommandContainer" local:DockPanel.Dock="Top" Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Row="0" Grid.Column="0">
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Center" Height="48">
                                    <Button x:Name="ButtonBoldElement" Content="Bold"/>
                                    <Button x:Name="ButtonItalicElement" Content="Italic"/>
                                    <Button x:Name="ButtonUnderlineElement" Content="Underline"/>
                                    <Button x:Name="ButtonIndentElement" Content="In"/>
                                    <Button x:Name="ButtonOutdentElement" Content="Out"/>
                                    <Button x:Name="ButtonAlignLeftElement" Content="Left"/>
                                    <Button x:Name="ButtonAlignCenterElement" Content="Center"/>
                                    <Button x:Name="ButtonAlignRightElement" Content="Right"/>
                                    <Button x:Name="ButtonAlignJustifyElement" Content="Justifiy"/>
                                    <Button x:Name="ButtonOrderedListElement" Content="OL"/>
                                    <Button x:Name="ButtonBulletedListElement" Content="BL"/>
                                    <Button x:Name="ButtonHorizontalRuleElement" Content="HR"/>
                                    <Button x:Name="ButtonSubscriptElement" Content="SbS"/>
                                    <Button x:Name="ButtonSuperscriptElement" Content="SsS"/>
                                    <ToggleButton x:Name="ButtonForeColorElement" Content="ForeColor"/>
                                    <ToggleButton x:Name="ButtonBackgroundColorElement" Content="BackgroundColor"/>
                                </StackPanel>
                                <StackPanel x:Name="ForeColorPalette" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Left" Height="0">
                                    <Button Content="" Tag="#FF0000" Background="#FFFF0000" Style="{StaticResource MenuColorButtonStyle}"/>
                                    <Button Content="" Tag="#FF9900" Background="#FFFF9900" Style="{StaticResource MenuColorButtonStyle}"/>
                                    <Button Content="" Tag="#00FF00" Background="#FF00FF00" Style="{StaticResource MenuColorButtonStyle}"/>
                                </StackPanel>
                                <StackPanel x:Name="BackgroundColorPalette" Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Height="0">
                                    <Button Content="" Tag="#FF0000" Background="#FFFF0000" Style="{StaticResource MenuColorButtonStyle}"/>
                                    <Button Content="" Tag="#FF9900" Background="#FFFF9900" Style="{StaticResource MenuColorButtonStyle}"/>
                                    <Button Content="" Tag="#00FF00" Background="#FF00FF00" Style="{StaticResource MenuColorButtonStyle}"/>
                                </StackPanel>
                            </StackPanel>
                            <Canvas x:Name="IframePlaceElement" Background="Transparent" Margin="4, 4, 4, 4" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                        </local:DockPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:DoubleSlider">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:DoubleSlider">

                    <Grid x:Name="LayoutRoot">
                        <Grid.Resources>
                            <Style x:Key="SliderMinStyle" TargetType="Slider">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Slider">
                                            <Grid Height="3" x:Name="Root" Width="Auto">
                                                <Grid.Resources>
                                                    <ControlTemplate x:Key="RepeatButtonTemplate">
                                                        <Grid x:Name="Root" Opacity="0" Background="Transparent"/>
                                                    </ControlTemplate>
                                                </Grid.Resources>
                                                <Grid.ColumnDefinitions>
                                                    <ColumnDefinition Width="0.028*"/>
                                                    <ColumnDefinition Width="0.972*"/>
                                                </Grid.ColumnDefinitions>
                                                <Grid.RowDefinitions>
                                                    <RowDefinition Height="0.45*"/>
                                                    <RowDefinition Height="0.55*"/>
                                                </Grid.RowDefinitions>
                                                <Grid Height="Auto" Width="Auto" x:Name="HorizontalTemplate" Grid.RowSpan="2" Grid.ColumnSpan="2">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                        <ColumnDefinition Width="*"/>
                                                    </Grid.ColumnDefinitions>
                                                    <Rectangle Height="3" Margin="5,0,5,0" Grid.Column="0" Grid.ColumnSpan="3" Fill="#FFE6EFF7" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Center"/>
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0"/>
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2"/>
                                                    <Thumb Height="11" Margin="0,-11,0,0"  x:Name="HorizontalThumb" VerticalAlignment="Top" Width="11" Grid.Column="1" />
                                                </Grid>
                                                <Grid  Height="Auto" Width="Auto" x:Name="VerticalTemplate" Grid.RowSpan="2" Grid.ColumnSpan="2">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="*"/>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <Rectangle Margin="0,5,0,5" Width="3" Grid.Row="0" Grid.RowSpan="3" Fill="#FFE6EFF7" Stroke="Black" StrokeThickness="0.5"/>
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Grid.Row="2"/>
                                                    <Thumb Height="11" x:Name="VerticalThumb" Width="11" Grid.Row="1" Margin="-14,0,0,0" />
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" Grid.Row="0"/>
                                                </Grid>
                                                <Rectangle x:Name="FocusVisual" IsHitTestVisible="false" Opacity="0" Stroke="#666666" StrokeDashArray=".2 5" StrokeDashCap="Round" Grid.RowSpan="1" Grid.ColumnSpan="2" Margin="0,0,0,0"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                            <Style x:Key="SliderMaxStyle" TargetType="Slider">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="Slider">
                                            <Grid Height="3" x:Name="Root" Width="Auto">
                                                <Grid.Resources>
                                                    <ControlTemplate x:Key="RepeatButtonTemplate">
                                                        <Grid x:Name="Root" Opacity="0" Background="Transparent"/>
                                                    </ControlTemplate>
                                                </Grid.Resources>
                                                <Grid Height="Auto" x:Name="HorizontalTemplate" Width="Auto">
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="Auto"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                        <ColumnDefinition Width="*"/>
                                                    </Grid.ColumnDefinitions>
                                                    <Rectangle Height="3" Margin="5,0,5,0" Grid.Column="0" Grid.ColumnSpan="3" Fill="#FFE6EFF7" Stroke="Black" StrokeThickness="0.5" VerticalAlignment="Center"/>
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0"/>
                                                    <Thumb Height="11" Margin="0,0,0,-11" x:Name="HorizontalThumb" VerticalAlignment="Bottom" Width="11" Grid.Column="1" />
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2"/>
                                                </Grid>
                                                <Grid Height="Auto" Width="Auto"  x:Name="VerticalTemplate" >
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="*"/>
                                                        <RowDefinition Height="Auto"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <Rectangle Margin="0,5,0,5" Width="3" Grid.Row="0" Grid.RowSpan="3" Fill="#FFE6EFF7" Stroke="Black" StrokeThickness="0.5"/>
                                                    <RepeatButton IsTabStop="False" DataContext="this" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" Grid.Row="2"/>
                                                    <Thumb Height="11" x:Name="VerticalThumb" Width="11" Grid.Row="1" Margin="0,0,12,0" HorizontalAlignment="Right"/>
                                                    <RepeatButton IsTabStop="False" Template="{StaticResource RepeatButtonTemplate}" x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" Grid.Row="0"/>
                                                </Grid>
                                                <Rectangle x:Name="FocusVisual" IsHitTestVisible="false" Opacity="0" Stroke="#666666" StrokeDashArray=".2 5" StrokeDashCap="Round"/>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>


                        </Grid.Resources>
                        
                   
                        <Slider x:Name="Slider1" SmallChange="{TemplateBinding SmallChange}" LargeChange="{TemplateBinding LargeChange}" 
                                                  Minimum="{TemplateBinding Minimum}"  Maximum="{TemplateBinding Maximum}"  
                                                  Orientation="{TemplateBinding Orientation}"
                                                  Margin="8,0,0,0" VerticalAlignment="Center"  Cursor="{TemplateBinding Cursor}"  
                                                   Style="{StaticResource SliderMinStyle}" 
                                />
                        <Slider x:Name="Slider2" SmallChange="{TemplateBinding SmallChange}" LargeChange="{TemplateBinding LargeChange}" 
                                              Minimum="{TemplateBinding Minimum}"  Maximum="{TemplateBinding Maximum}"  
                                              Orientation="{TemplateBinding Orientation}"
                                              Margin="8,0,0,0" VerticalAlignment="Center"  Cursor="{TemplateBinding Cursor}"  
                                Style="{StaticResource SliderMaxStyle}" 
                                               />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:Separator">

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Separator">
                    <StackPanel Orientation="{TemplateBinding Orientation}">
                        <Rectangle Fill="#FF8CACD5" MinWidth="1" MinHeight="1" StrokeThickness="0"/>
                        <Rectangle Fill="#FFE8F1FC" MinWidth="1" MinHeight="1" StrokeThickness="0"/>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style TargetType="local:Decorator">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Decorator">
                    <Border x:Name="outer" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                        <Border x:Name="inner"  BorderBrush="{TemplateBinding InnerBorderBrush}" BorderThickness="{TemplateBinding InnerBorderThickness}"
                                Background="{TemplateBinding Background}">
                            <ContentPresenter Content="{TemplateBinding Content}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              />
                        </Border>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="0,1,1,0"/>
        <Setter Property="InnerBorderThickness" Value="0,1,1,0"/>
        <Setter Property="BorderBrush" Value="#FF567DB0"/>
        <Setter Property="InnerBorderBrush" Value="#FFFFFFFF"/>
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,0" StartPoint="0.5,1">
                    <GradientStop Color="#FFB0CBEF"/>
                    <GradientStop Color="#FFD7E6F9" Offset="1"/>
                    <GradientStop Color="#FFD7E5F7" Offset="0.019"/>
                    <GradientStop Color="#FFB3D0F5" Offset="0.64"/>
                    <GradientStop Color="#FFC7DCF8" Offset="0.65"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:ColorPicker">
        <Setter Property="Width" Value="200" />
        <Setter Property="Height" Value="200" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:ColorPicker">
                    <StackPanel x:Name="RootElement">
                        <StackPanel Orientation="Horizontal">
                            <Canvas Width="20" Height="180">
                                <Rectangle x:Name="HueMonitor" Width="20" Height="180">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint ="0,0" EndPoint="0,1">
                                            <GradientStop Offset="0.00" Color="#ffff0000"/>
                                            <GradientStop Offset="0.17" Color="#ffffff00"/>
                                            <GradientStop Offset="0.33" Color="#ff00ff00"/>
                                            <GradientStop Offset="0.50" Color="#ff00ffff"/>
                                            <GradientStop Offset="0.66" Color="#ff0000ff"/>
                                            <GradientStop Offset="0.83" Color="#ffff00ff"/>
                                            <GradientStop Offset="1.00" Color="#ffff0000"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Canvas x:Name="HueSelector" IsHitTestVisible="False" Height="8" Canvas.Left="0" Canvas.Top="-4">
                                    <Path Width="5" Height="8" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FF000000" Data="F1 M 276.761,316L 262.619,307.835L 262.619,324.165L 276.761,316 Z " />
                                    <Path Width="5" Height="8" Canvas.Top="8" Canvas.Left="20" Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FF000000" Data="F1 M 276.761,316L 262.619,307.835L 262.619,324.165L 276.761,316 Z ">
                                        <Path.RenderTransform>
                                            <RotateTransform Angle="180" />
                                        </Path.RenderTransform>
                                    </Path>
                                </Canvas>
                            </Canvas>
                            <Canvas Canvas.Top="0" Canvas.Left="20">
                                <Rectangle x:Name="ColorSample" Width="180" Height="180" Fill="Red"></Rectangle>
                                <Rectangle x:Name="WhiteGradient" IsHitTestVisible="False" Width="180" Height="180">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint="0,0" EndPoint="1,0">
                                            <GradientStop Offset="0" Color="#ffffffff"/>
                                            <GradientStop Offset="1" Color="#00ffffff"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Rectangle x:Name="BlackGradient" IsHitTestVisible="False" Width="180" Height="180">
                                    <Rectangle.Fill>
                                        <LinearGradientBrush StartPoint="0,1" EndPoint="0, 0">
                                            <GradientStop Offset="0" Color="#ff000000"/>
                                            <GradientStop Offset="1" Color="#00000000"/>
                                        </LinearGradientBrush>
                                    </Rectangle.Fill>
                                </Rectangle>
                                <Canvas x:Name="SampleSelector" IsHitTestVisible="False" Width="10" Height="10" Canvas.Left="100" Canvas.Top="96">
                                    <Ellipse Width="10" Height="10" StrokeThickness="3" Stroke="#FFFFFFFF"/>
                                    <Ellipse Width="10" Height="10" StrokeThickness="1" Stroke="#FF000000"/>
                                </Canvas>
                            </Canvas>
                        </StackPanel>

                        <StackPanel Orientation="Horizontal">
                            <Grid>
                                <Rectangle Width="60" Height="20" Fill="Black" />
                                <TextBlock x:Name="HexValue" 
                                           Foreground="White" 
                                           Text="#FF0000" 
                                           FontFamily="Arial" 
                                           FontSize="11" 
                                           TextAlignment="Center" 
                                           VerticalAlignment="Center" 
                                           HorizontalAlignment="Center" />
                            </Grid>
                            <Rectangle x:Name="SelectedColorView" Width="140" Height="20" Fill="Black" />
                        </StackPanel>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:Timeline">
        <Setter Property="Background" Value="#80FFFFFF" />
        <Setter Property="Template" >
            <Setter.Value>
                <ControlTemplate TargetType="local:Timeline">
                    <Grid x:Name="LayoutRoot" Background="Transparent"  >
                        <Grid.Resources>
                            <sld:InvertConverter x:Key="invConverter" />
                            <LinearGradientBrush x:Key="OrangeBrush" StartPoint="0.954379,1.01791" EndPoint="0.954379,-0.0463469">
                                <GradientStop Color="#FFD4622A" Offset="0.419492"/>
                                <GradientStop Color="#FFE27A47" Offset="0.699923"/>
                                <GradientStop Color="#FFF78B55" Offset="0.860169"/>
                                <GradientStop Color="#FFD4622A" Offset="1"/>
                            </LinearGradientBrush>
                        </Grid.Resources>
                        <Grid.OpacityMask>
                            <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
                                <GradientStop Color="#00000000" Offset="0"/>
                                <GradientStop Color="#00000000" Offset="1"/>
                                <GradientStop Color="#FF000000" Offset="0.05"/>
                                <GradientStop Color="#FF000000" Offset="0.95"/>
                            </LinearGradientBrush>
                        </Grid.OpacityMask>

                        <Rectangle Fill="{TemplateBinding Background}" Height="6" VerticalAlignment="Center" />
                        <Canvas x:Name="Marker" HorizontalAlignment="Center" Height="6" VerticalAlignment="Center" >

                            <Rectangle DataContext="{TemplateBinding EllapsedTime}" Width="{TemplateBinding Duration}" 
                                       Fill="{StaticResource OrangeBrush}"
                                       Canvas.Left="{Binding Converter={StaticResource invConverter}}"
                                       Height="6"/>
                            <Border Width="3" Height="12" IsHitTestVisible="False" Canvas.Top="-3">
                                <Grid >
                                    <Rectangle x:Name="l" Width="3" Margin="-3,0,0,0" HorizontalAlignment="Left" Stretch="Fill">
                                        <Rectangle.Fill>
                                            <RadialGradientBrush RadiusX="0.501004" RadiusY="0.990059" Center="0.98387,0.499997" GradientOrigin="0.98387,0.499997">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <RotateTransform CenterX="0.98387" CenterY="0.499997" Angle="90"/>
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop Color="#80000000" Offset="0"/>
                                                <GradientStop Color="#41000000" Offset="0.535575"/>
                                                <GradientStop Color="#00000000" Offset="0.983871"/>
                                            </RadialGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <Rectangle x:Name="r" Width="3" Margin="0,0,-3,0" HorizontalAlignment="Right" >
                                        <Rectangle.Fill>
                                            <RadialGradientBrush RadiusX="0.501004" RadiusY="0.990059" Center="0.0161297,0.5" GradientOrigin="0.0161297,0.5">
                                                <RadialGradientBrush.RelativeTransform>
                                                    <TransformGroup>
                                                        <RotateTransform CenterX="0.0161297" CenterY="0.5" Angle="-90"/>
                                                    </TransformGroup>
                                                </RadialGradientBrush.RelativeTransform>
                                                <GradientStop Color="#80000000" Offset="0"/>
                                                <GradientStop Color="#41000000" Offset="0.535575"/>
                                                <GradientStop Color="#00000000" Offset="0.983871"/>
                                            </RadialGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                    <Rectangle x:Name="c" >
                                        <Rectangle.Fill>
                                            <LinearGradientBrush StartPoint="1.04908,-0.0509299" EndPoint="1.04908,0.996687">
                                                <GradientStop Color="#00FFFFFF" Offset="0"/>
                                                <GradientStop Color="#FFFFFFFF" Offset="0.368627"/>
                                                <GradientStop Color="#FFFFFFFF" Offset="0.678431"/>
                                                <GradientStop Color="#80FFFFFF" Offset="0.883066"/>
                                                <GradientStop Color="#00FFFFFF" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </Grid>
                            </Border>
                        </Canvas>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
